﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/Admin.Master" AutoEventWireup="true" CodeBehind="InfoSchool.aspx.cs" Inherits="mamnontuoitho7.backend.InfoSchool"  ValidateRequest="false"  %>
<%@ Import Namespace="mamnontuoitho7.AppCode" %>

<asp:Content ID="Content1" ContentPlaceHolderID="AdminTitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<form id="form1" runat="server">

<script language="javascript" type="text/javascript">
    function Save() {

        var shoolName = trim(document.getElementById("<%= txtSchoolName.ClientID %>").value);
        var address = trim(document.getElementById("<%= txtAddress.ClientID %>").value);
        var phone = trim(document.getElementById("<%= txtPhone.ClientID %>").value);
        var email = trim(document.getElementById("<%= txtEmail.ClientID %>").value);

        if (shoolName == null || shoolName == "") {
            alert("Tên trường không được để trống.");
                document.getElementById("<%= txtSchoolName.ClientID %>").focus();
                return false;
        }

        if (phone != null && phone != "") {
            if (!/<%= ConstantClass.testPhoneRegular_1 %>/.test(phone)) {
                alert("Số điện thoại phải có định dạng:\n###### hay +##.##### hay ##.###.##### hay ## ## ##.##.## hay (##) ##.###.##");
                document.getElementById("<%= txtPhone.ClientID %>").focus();
                return false;
            }
        }

        if (email != null && email != "") {
            if (!/<%= ConstantClass.testEmailRegular_1 %>/.test(email)) {
                alert("Không đúng định dạng email.");
                document.getElementById("<%= txtEmail.ClientID %>").focus();
                return false;
            }
        }

        if (address == null || address == "") {
            alert("Địa chỉ trường không được để trống.");
                document.getElementById("<%= txtAddress.ClientID %>").focus();
                return false;
        }

        return true;

    }


    function trim(str) {
        return str.replace(/^\s+|\s+$/g, "");
    }
    </script>

    <!-- Begin one column tab content window -->
    <div class="onecolumn">
	    <div class="header">
		    <span>Thông Tin Liên Hệ</span>
	    </div>
	    <br class="clear"/>
	    <div class="content">
		    <div id="tab2_content" class="tab_content">
                <div class="tableform">
                    <div>
                        Tên trường:<br />
                        <asp:TextBox ID="txtSchoolName" runat="server" style="width:750px;" 
                            MaxLength="100" TabIndex="1"></asp:TextBox></div><br />
                    <div>
                        <div class="left">
                            Số điện thoại:<br />
                            <asp:TextBox ID="txtPhone" runat="server" style="width:340px;" MaxLength="100" 
                                TabIndex="2"></asp:TextBox>
                        </div>
                        <div class="right">
                            Số fax:<br />
                            <asp:TextBox ID="txtFax" runat="server" style="width:340px;" MaxLength="100" 
                                TabIndex="3"></asp:TextBox>
                        </div>
                    </div><br class="clear"/><br />
                    <div>
                        <div class="left">
                            Email:<br />
                            <asp:TextBox ID="txtEmail" runat="server" style="width:340px;" MaxLength="100" 
                                TabIndex="4"></asp:TextBox>
                        </div>
                        <div class="right">
                            Website:<br />
                            <asp:TextBox ID="txtWebsite" runat="server" style="width:340px;" 
                                MaxLength="200" TabIndex="5"></asp:TextBox>
                        </div>
                    </div><br class="clear"/><br />
                    <div>
                        Địa chỉ:<br />
                        <asp:TextBox ID="txtAddress" TextMode="MultiLine" runat="server" 
                            style="width:750px; min-height:100px;" MaxLength="200" TabIndex="6"></asp:TextBox></div><br />
                    <p>
				        <asp:Button ID="btnContactEdit" runat="server" Text="Lưu" 
                            onclick="btnContactEdit_Click" TabIndex="7" OnClientClick="return Save()"/>
                        </p>
                </div>
	  		    <br class="clear"/>
		    </div>
	    </div>
    </div>
    <!-- End one column tab content window -->
    <br />
    <asp:Label ID="lblNotice" runat="server" visible="False"  
                                ForeColor="Red" Font-Bold="True" Font-Size="Medium" ></asp:Label>

</form>
</asp:Content>
